Optimal. Leaf size=129 \[ \frac {i a^3 B x}{c^3}+\frac {a^3 B \log (\cos (e+f x))}{c^3 f}-\frac {a^3 (i A+B) (1+i \tan (e+f x))^3}{6 c^3 f (1-i \tan (e+f x))^3}-\frac {2 a^3 B}{c^3 f (i+\tan (e+f x))^2}-\frac {4 i a^3 B}{c^3 f (i+\tan (e+f x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.10, antiderivative size = 129, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.073, Rules used = {3669, 79, 45}
\begin {gather*} -\frac {a^3 (B+i A) (1+i \tan (e+f x))^3}{6 c^3 f (1-i \tan (e+f x))^3}-\frac {4 i a^3 B}{c^3 f (\tan (e+f x)+i)}-\frac {2 a^3 B}{c^3 f (\tan (e+f x)+i)^2}+\frac {a^3 B \log (\cos (e+f x))}{c^3 f}+\frac {i a^3 B x}{c^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 45
Rule 79
Rule 3669
Rubi steps
\begin {align*} \int \frac {(a+i a \tan (e+f x))^3 (A+B \tan (e+f x))}{(c-i c \tan (e+f x))^3} \, dx &=\frac {(a c) \text {Subst}\left (\int \frac {(a+i a x)^2 (A+B x)}{(c-i c x)^4} \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac {a^3 (i A+B) (1+i \tan (e+f x))^3}{6 c^3 f (1-i \tan (e+f x))^3}+\frac {(i a B) \text {Subst}\left (\int \frac {(a+i a x)^2}{(c-i c x)^3} \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac {a^3 (i A+B) (1+i \tan (e+f x))^3}{6 c^3 f (1-i \tan (e+f x))^3}+\frac {(i a B) \text {Subst}\left (\int \left (-\frac {4 i a^2}{c^3 (i+x)^3}+\frac {4 a^2}{c^3 (i+x)^2}+\frac {i a^2}{c^3 (i+x)}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {i a^3 B x}{c^3}+\frac {a^3 B \log (\cos (e+f x))}{c^3 f}-\frac {a^3 (i A+B) (1+i \tan (e+f x))^3}{6 c^3 f (1-i \tan (e+f x))^3}-\frac {2 a^3 B}{c^3 f (i+\tan (e+f x))^2}-\frac {4 i a^3 B}{c^3 f (i+\tan (e+f x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.65, size = 167, normalized size = 1.29 \begin {gather*} \frac {a^3 \left (-3 B \cos (e+f x)+\cos (3 (e+f x)) \left (-i A-B+6 i B f x+3 B \log \left (\cos ^2(e+f x)\right )\right )+9 i B \sin (e+f x)+A \sin (3 (e+f x))-i B \sin (3 (e+f x))+6 B f x \sin (3 (e+f x))-3 i B \log \left (\cos ^2(e+f x)\right ) \sin (3 (e+f x))\right ) (\cos (3 (e+2 f x))+i \sin (3 (e+2 f x)))}{6 c^3 f (\cos (f x)+i \sin (f x))^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.30, size = 88, normalized size = 0.68
method | result | size |
derivativedivides | \(\frac {a^{3} \left (-\frac {5 i B -A}{i+\tan \left (f x +e \right )}-\frac {-4 i B +4 A}{3 \left (i+\tan \left (f x +e \right )\right )^{3}}-\frac {4 i A +8 B}{2 \left (i+\tan \left (f x +e \right )\right )^{2}}-B \ln \left (i+\tan \left (f x +e \right )\right )\right )}{f \,c^{3}}\) | \(88\) |
default | \(\frac {a^{3} \left (-\frac {5 i B -A}{i+\tan \left (f x +e \right )}-\frac {-4 i B +4 A}{3 \left (i+\tan \left (f x +e \right )\right )^{3}}-\frac {4 i A +8 B}{2 \left (i+\tan \left (f x +e \right )\right )^{2}}-B \ln \left (i+\tan \left (f x +e \right )\right )\right )}{f \,c^{3}}\) | \(88\) |
risch | \(-\frac {{\mathrm e}^{6 i \left (f x +e \right )} B \,a^{3}}{6 c^{3} f}-\frac {i {\mathrm e}^{6 i \left (f x +e \right )} A \,a^{3}}{6 c^{3} f}+\frac {B \,a^{3} {\mathrm e}^{4 i \left (f x +e \right )}}{2 c^{3} f}-\frac {B \,a^{3} {\mathrm e}^{2 i \left (f x +e \right )}}{c^{3} f}-\frac {2 i B \,a^{3} e}{c^{3} f}+\frac {B \,a^{3} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )}{c^{3} f}\) | \(124\) |
norman | \(\frac {\frac {\left (-i B \,a^{3}+A \,a^{3}\right ) \tan \left (f x +e \right )}{c f}+\frac {\left (-5 i B \,a^{3}+A \,a^{3}\right ) \left (\tan ^{5}\left (f x +e \right )\right )}{c f}+\frac {i B \,a^{3} x}{c}+\frac {i B \,a^{3} x \left (\tan ^{6}\left (f x +e \right )\right )}{c}-\frac {i A \,a^{3}+7 B \,a^{3}}{3 c f}-\frac {2 \left (i B \,a^{3}+5 A \,a^{3}\right ) \left (\tan ^{3}\left (f x +e \right )\right )}{3 c f}-\frac {\left (-2 i A \,a^{3}+6 B \,a^{3}\right ) \left (\tan ^{2}\left (f x +e \right )\right )}{c f}-\frac {3 \left (i A \,a^{3}+3 B \,a^{3}\right ) \left (\tan ^{4}\left (f x +e \right )\right )}{c f}+\frac {3 i B \,a^{3} x \left (\tan ^{2}\left (f x +e \right )\right )}{c}+\frac {3 i B \,a^{3} x \left (\tan ^{4}\left (f x +e \right )\right )}{c}}{c^{2} \left (1+\tan ^{2}\left (f x +e \right )\right )^{3}}-\frac {B \,a^{3} \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2 c^{3} f}\) | \(276\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 5.15, size = 81, normalized size = 0.63 \begin {gather*} \frac {{\left (-i \, A - B\right )} a^{3} e^{\left (6 i \, f x + 6 i \, e\right )} + 3 \, B a^{3} e^{\left (4 i \, f x + 4 i \, e\right )} - 6 \, B a^{3} e^{\left (2 i \, f x + 2 i \, e\right )} + 6 \, B a^{3} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right )}{6 \, c^{3} f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.48, size = 212, normalized size = 1.64 \begin {gather*} \frac {B a^{3} \log {\left (e^{2 i f x} + e^{- 2 i e} \right )}}{c^{3} f} + \begin {cases} \frac {6 B a^{3} c^{6} f^{2} e^{4 i e} e^{4 i f x} - 12 B a^{3} c^{6} f^{2} e^{2 i e} e^{2 i f x} + \left (- 2 i A a^{3} c^{6} f^{2} e^{6 i e} - 2 B a^{3} c^{6} f^{2} e^{6 i e}\right ) e^{6 i f x}}{12 c^{9} f^{3}} & \text {for}\: c^{9} f^{3} \neq 0 \\\frac {x \left (A a^{3} e^{6 i e} - i B a^{3} e^{6 i e} + 2 i B a^{3} e^{4 i e} - 2 i B a^{3} e^{2 i e}\right )}{c^{3}} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 255 vs. \(2 (118) = 236\).
time = 1.01, size = 255, normalized size = 1.98 \begin {gather*} \frac {\frac {30 \, B a^{3} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1\right )}{c^{3}} - \frac {60 \, B a^{3} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + i\right )}{c^{3}} + \frac {30 \, B a^{3} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1\right )}{c^{3}} + \frac {147 \, B a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{6} - 60 \, A a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} + 942 i \, B a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} - 2445 \, B a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} + 200 \, A a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 3620 i \, B a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 2445 \, B a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 60 \, A a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 942 i \, B a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 147 \, B a^{3}}{c^{3} {\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + i\right )}^{6}}}{30 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 8.97, size = 141, normalized size = 1.09 \begin {gather*} -\frac {a^3\,\left (15\,B\,{\mathrm {tan}\left (e+f\,x\right )}^2-7\,B+B\,\mathrm {tan}\left (e+f\,x\right )\,18{}\mathrm {i}+A\,{\mathrm {tan}\left (e+f\,x\right )}^2\,3{}\mathrm {i}-A\,1{}\mathrm {i}-3\,B\,\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )+B\,\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )\,\mathrm {tan}\left (e+f\,x\right )\,9{}\mathrm {i}+9\,B\,\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )\,{\mathrm {tan}\left (e+f\,x\right )}^2-B\,\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )\,{\mathrm {tan}\left (e+f\,x\right )}^3\,3{}\mathrm {i}\right )}{3\,c^3\,f\,{\left (-1+\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}^3} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________